- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10.5k
Update CookieAuthenticationOptions XML documentation to clarify ExpireTimeSpan usage #64122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CookieAuthenticationOptions XML documentation to clarify ExpireTimeSpan usage #64122
Conversation
Co-authored-by: MackinnonBuck <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR corrects misleading XML documentation for the ExpireTimeSpan property in CookieAuthenticationOptions. The original documentation incorrectly implied that CookieOptions.Expires could be used separately to control browser cookie lifetime, when in fact attempting to set it throws a validation exception.
Key Changes:
- Updated XML documentation to clarify that ExpireTimeSpanshould be used instead ofCookieOptions.Expires, not in addition to it
- Removed misleading language that suggested CookieOptions.Expirescould be used to separately control browser cookie lifetime
- Aligned documentation with actual implementation behavior where the handler overrides cookie expiration based on ExpireTimeSpan
        
          
                src/Security/Authentication/Cookies/src/CookieAuthenticationOptions.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …documentation Co-authored-by: MackinnonBuck <[email protected]>
Documentation Fix: Update CookieAuthenticationOptions XML Comments
Plan
ExpireTimeSpanproperty incorrectly suggests usingCookieOptions.Expiresas a separate control, but this property is actually ignored/validated againstExpireTimeSpanpropertyCookieBuilder.Expirationinstead ofCookieOptions.Expiresfor consistency ✓Changes Summary
Updated the XML documentation comment for the
ExpireTimeSpanproperty inCookieAuthenticationOptions.csto correctly reflect the implementation.Final change:
CookieOptions.ExpirestoCookieBuilder.Expirationto be consistent with:CookieBuilder.ExpirationDocumentation now states:
/// This property should be used instead of <see cref="CookieBuilder.Expiration"/>, which is ignored.This ensures consistency throughout the codebase and aligns with how developers actually interact with the API (via
Cookie.ExpirationwhereCookieis of typeCookieBuilder).Original prompt
Fixes #64074
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.